package com.bupt.kgplatform.mapper;


import com.bupt.kgplatform.entity.pojo.NewsInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * ClassName:NewsInfoMapper
 * Package:com.example.blackjavaweb.mapper
 * Description:
 *
 * @Author QIQI_1999
 * @Creat 2023/10/8 15:11
 * @Version 1.0
 */
@Mapper
public interface NewsInfoMapper {

    @Select("select title, data, author, url, source, abstracts, content_english from news_table where source = #{sourceQuestion} limit #{begin}, #{num}")
    List<NewsInfo> getNewsInfoAll(String sourceQuestion, int begin, int num);

    @Select("select count(*) from news_table where source = #{source}")
    int getNewsInfoNum(String source);


    @Select("SELECT max(data) FROM news_table where source = #{source}")
    String getNewData(String source);
}
